<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.0.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("#upd").click(function() {
			if($("#productName").val()==""){
				alert("상품명을 적으세요");
				return false;
			}
			if(isNaN($("#productPrice").val())){
				alert("가격을 숫자로 입력하세요!");
				return false;
			}
			if($("#productPrice").val()==""){
				alert("가격을 적으세요");
				return false;
			}
			if($("#productMaker").val()==""){
				alert("제조사를 적으세요");
				return false;
			}
			if($("#productInfo").val()==""){
				alert("상품정보를 적으세요");
				return false;
			}
			if($("#productTitle").val()==""){
				alert("타이틀을 적으세요");
				return false;
			}		
		});
	});
</script>
</head>
<body>
<form method="post" action="updateProduct.do" >
<table border="1" cellpadding="5">
	<tr><th>상품Id</th><td><input type="text" name="productId" value="${requestScope.map.pvo.productId }" readonly="readonly"></td></tr>	
	<tr><th>상품명</th><td><input type="text" id="productName" name="productName" value="${requestScope.map.pvo.productName }"></td></tr>	
	<tr><th>가격</th><td><input type="text" id="productPrice" name="productPrice" value="${requestScope.map.pvo.productPrice }"></td></tr>	
	<tr><th>제조사</th><td><input type="text" id="productMaker" name="productMaker" value="${requestScope.map.pvo.productMaker }"></td></tr>	
	<tr><th>등록일</th><td><input type="text" value="${requestScope.map.pvo.productDate }" readonly="readonly"></td></tr>	
	<tr><th>상품정보</th><td><input type="text" id="productInfo" name="productInfo" value="${requestScope.map.pvo.productInfo }"></td></tr>	
	<tr><th>타이틀</th><td><input type="text" id="productTitle" name="productTitle" value="${requestScope.map.pvo.productTitle }"></td></tr>	
	<tr><th>품목</th><td><select name="productCategory">
							<option value="${requestScope.map.pvo.productCategory }">${requestScope.map.pvo.productCategory }</option>
							<c:forEach items="${requestScope.map.list }" var="li">
								<c:if test="${li!=requestScope.map.pvo.productCategory}">
									<option>${li }</option>
								</c:if>	
							</c:forEach>
						</select>
	</td></tr>	
	<tr><th>판매량</th><td><input type="text" value="${requestScope.map.pvo.inventoryVO.salesVolume }" readonly="readonly"></td></tr>	
</table>
<input type="submit" id="upd" value="상품 업데이트">
</form>
</body>
</html>